1. Technical Field
The present invention relates to a control apparatus performing operation control of various kinds of actuators on the basis of a computer program. In particular, the present invention relates to a control apparatus, a control method, and a computer program in which the computer program has a configuration that permits memory saving and realizes apparatus simplification and in which addition and removal of various kinds of functions for individual actuators are treated flexibly so that development efficiency is improved.
2. Description of Related Art
In a microcomputer-based control apparatus performing control on the basis of computer programs stored in a ROM built in the microcomputer, such computer programs are described in an embedded language. Such computer programs described in an embedded language is configured for that resources such as a memory are saved for the purpose of simplification of the apparatus and that minimum necessary processing alone is installed for each controlled object and for each function.
FIG. 1 is a diagram illustrating a schematic configuration of a computer program in a related art microcomputer. The configuration of the computer program illustrated in FIG. 1 is, in particular, an example of a computer program executed by a microcomputer in a control apparatus controlling the operation of a controlled object (actuator X). In FIG. 1, functions implemented by the computer program are illustrated in the form of blocks. When the computer program in the example in FIG. 1 implements the function targeting the actuator X serving as a controlled object, as illustrated in FIG. 1, the computer program is implemented in correspondence to each of functions (a) and (b) to be realized by the application programs, for each of functions such as: judgment processing for signals A, B, and C respectively inputted from sensors or actuators; judgment processing for judging operation to be requested for the actuator X in order to realize a function on the basis of the judgment result of the input signals; arbitration of signal outputs for operation requests to the actuator; and signal output to the actuator for each operation.
Further, on the installation of the computer program, a corresponding program code (execution file) is generated separately for each function. Then, these program codes are stored in advance in the memory and read by the CPU. Thus, a memory area is occupied separately by each block illustrated in FIG. 1. That is, for example, as for the judgment processing onto the input signals, a program code is provided separately for each of the functions (a) and (b) and for each of the signals A, B, and C.
The example illustrated in FIG. 1 is a configuration that the function is different between (a) and (b) but a program code corresponding to the input signal judgment module is provided separately even for the same input signal A. When a situation that the functions (a) and (b) are simultaneously executed in parallel is avoided, such a configuration that a program code is provided separately for each function causes inefficient memory usage.
Further, in the judgment processing onto the input signals, in general, on the basis of each signal level of Hi or Low, it is judged whether the switch is ON or OFF, whether the state is locked or unlocked, or the like. That is, although the contents of the input signal is different from each other, the detailed contents of the processing of judgment processing is common, i.e., judgment whether the signal level is Hi or Low. The configuration that a program code for this judgment processing is provided separately for each of various kinds of input signals causes inefficient memory usage.
Further, in this case, judgment on the input signals A, B, and C is not simultaneously performed, that is, judgment on the input signals A, B, and C is performed sequentially. Furthermore, operation in accordance with the judgment result is also performed sequentially, and hence the memory areas storing the program codes for the judgment processing onto the input signals are not simultaneously accessed. In spite of such a situation, program codes each corresponding to each operation to be executed by the microcomputer occupy the memory area permanently. This causes an inefficient memory utilization rate.
In contrast, with progress in diversification and complexity of functions required in control apparatuses, even a control apparatus is proposed in which programs described in an object-oriented programming language are read and executed by a microcomputer (see, for example, Japanese Patent Application Laid-Open No. 2008-77220). In this configuration, a memory area is allocated at each time of execution of processing, and then on completion of the processing, the memory area is released so as to be available for another processing. Thus, the memory usage efficiency is improved. Nevertheless, such a configuration requires basic functions (a library) that allow the microcomputer to perform processing like dynamic memory allocation during the program execution. As such, in a configuration designed in an object-oriented manner, in addition to a situation that library program codes for implementing the basic functions use a memory area, various kinds of processing is necessary like dynamic memory allocation and dynamic library linkage. Thus, various kinds of functions are achieved by a configuration of object-oriented computer programs only when the memory has a sufficient storage capacity.